# -*- encoding: utf-8 -*-
"""

PyCharm 14通过使用pie来绘制饼图
2024年 10月 27日 14:59
coded by wenyang
文件的主要内容


"""
import numpy as np
import matplotlib.pyplot as plt
import matplotlib as mpl


def main():
    mpl.rcParams["font.sans-serif"] = ["SimHei"]
    mpl.rcParams["axes.unicode_minus"] = False
    kinds = "简易箱", "保温箱", "行李箱", "密封箱"
    colors = ["r", "g", "b", "y"]
    soldNums = [0.05, 0.45, 0.15, 0.35]
    plt.pie(soldNums, labels = kinds, autopct = "%3.1f%%", shadow = True, startangle = 60, colors = colors)
    plt.title("不同类型的箱子的销售占比")
    plt.show()


if __name__ == "__main__":
    main()
